import axios from "axios"
import Config from "../config/index"

const service = axios.create({
  baseURL: Config.baseUrl,
  timeout: 1000 * 30 // 30s  超时时间
})

service.interceptors.request.use(config => {
   config.headers.token = Config.token
  return config
})

service.interceptors.response.use(config => {
  return config.data
})

export default service